package vn.fsoft.gst.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import vn.fsoft.gst.domain.Contact;
import vn.fsoft.gst.service.ContactService;

@Controller
public class ContactController {

	@Autowired
	private ContactService contactService;

	/**
	 * get list Address in database to user lookup when add Organisation,...
	 * @param model
	 * @return lookupAddress view
	 */
	@RequestMapping(value="/lookupContact", method=RequestMethod.GET)
	public String listContact(ModelMap model){
    	List<Contact> listContact = contactService.getListContact();   
    	model.addAttribute("listContact", listContact);
		return "lookupContact";
	}
}
